package com.xgp.microChat.dev;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.context.annotation.Profile;
import org.springframework.core.annotation.Order;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

@Component
@Profile("dev")
@Order(2)
public class MongoDbStart implements ApplicationRunner {

    @Autowired
    BatTool batTool;

    @Override
    @Async
    public void run(ApplicationArguments args) throws Exception {
        batTool.openMongoDb();
    }
}
